//
//  ZZCURLHostParser.swift
//  ewgShop
//
//  Created by zzc on 2019/8/5.
//  Copyright © 2019 zzc. All rights reserved.
//

import UIKit

class ZZCURLHostParser: NSObject {
    
    var whiteList = NSMutableArray.init()
    var balckList = NSMutableArray.init()
    
    /// 请求host是否白名单
    ///
    /// - Parameter host: <#host description#>
    /// - Returns: <#return value description#>
    func whiteListHasHost(host : String) -> Bool {
        return self.whiteList.contains(host);
    }
    
    func blackListHasHost(host : String) -> Bool {
        return self.balckList.contains(host);
    }
    
    func registerToWhiteListWithHost(host : String){
        if self.whiteListHasHost(host: host) {
            return;
        }
        self.whiteList.add(host)
    }
    
    func registerToBlackListWithHost(host:String){
        if self.blackListHasHost(host: host) {
            return
        }
        self.balckList.add(host)
    }
}
